package com.kfc.crazy4week;

import javax.swing.*;
import java.awt.*;
import java.util.Arrays;

/**
 * 核心测试代码
 */
public class GUI_V50 {
    public static void main(String[] args) {
        int[][] arr = {
                {1, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22}, {2, 8, 12, 18, 22},
                {3, 7, 12, 13, 14, 15, 16, 18, 22}, {4, 6, 16, 18, 22},
                {5, 5, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22},
        };
        JFrame frame = new JFrame("help me!");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        String str = "";
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < 30; j++) {
                if (Arrays.binarySearch(arr[i], j) > -1) {
                    str += "|";
                } else {
                    str += " ";
                }
            }
            str += "\n";
        }
        JTextPane jTextPane = new JTextPane();
        jTextPane.setText(str);
        jTextPane.setForeground(Color.white);
        jTextPane.setBackground(new Color(217, 53, 60));
        frame.getContentPane().add(jTextPane);
        frame.setSize(500, 500);
        frame.setVisible(true);
    }
}